<script setup lang='ts'>
import { FontIcons } from '@/enum';
import Icon from './icon/icon.vue';
</script>

<template>
  <div class="cursor-pointer search">
    <form>
      <input type="text" class="search_input">
    </form>
    <div class="h48px w48px ">
      <Icon :icon="FontIcons.搜索" class="search_icon"></Icon>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.search {
  display: flex;
  justify-content: flex-start;
  text-align: right;
  width: 200px;

  .search_input {
    width: 0px;
    border: 1px solid #eee;
    transition: width .5s ease-out;
    margin-right: -48rpx;
  }

  .search_icon {
    flex-shrink: 0;
    transition: transform .5s ease-out;
  }

  &:hover {
    .search_icon {
      transform: rotate(360deg);
    }

    .search_input {
      width: 200px;
    }
  }
}
</style>
